import { createRouter, createWebHistory } from "vue-router";
import Login from "@/views/Login/index.vue";
import Layout from "@/views/Layout/index.vue";
import Home from "@/views/Home/index.vue";
import Category from "@/views/Category/index.vue";
import Trivia from "@/views/Trivia/index.vue";
import Performer from "@/views/Performer/index.vue";
import Info from "@/views/Info/index.vue";
import Video from "@/views/Video/index.vue";
import Register from "@/views/Register/index.vue";
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      component: Layout,
      children: [
        {
          path: "",
          component: Home,
        },
        {
          path: "category",
          component: Category,
        },
        {
          path: "trivia",
          component: Trivia,
        },
        {
          path: "performer",
          component: Performer,
        },
        {
          path: "info",
          component: Info,
        },
        {
          path: "video",
          component: Video,
        },
      ],
    },
    {
      path: "/login",
      component: Login,
    },
    {
      path: "/register",
      component: Register,
    },
  ], // 路由滚动行为定制
  scrollBehavior() {
    return {
      top: 0,
    };
  },
});

export default router;
